import _ from 'lodash';
import keyMirror from 'keymirror';
export const actionTypes = keyMirror({
  DRAW_ATTR: null,
});
// export const actionTypes = keyMirror({
//   NULL: null,
//   DRAW_PT: null,
//   DEL_PT: null,
//   DRAW_LINE: null,
//   DEL_LINE: null,
// });

const initialState = null;
export default function drawAttr(state = initialState, action) {
  const type = _.get(action, 'type');
  const payload = _.get(action, 'payload', null);
  switch (type) {
    case actionTypes.DRAW_ATTR: {
      return state = payload;
    }
    default:
      return state;
  }
}